package netty.session;

import io.netty.channel.Channel;

public class SessionManager {
    private NettySessionStore<String, NettySession> localSession;

    public SessionManager() {
        this.localSession = new NettySessionStore<>(600, null);
    }

    public NettySession addSession(String sessionId, Channel channel) {
        NettySession s = new NettySession(sessionId, channel);
        localSession.put(sessionId, s);
        return s;
    }

    public NettySession getSession(String sessionId) {
        return localSession.get(sessionId);
    }

    public void removeSession(String sessionId) {
        localSession.remove(sessionId);
    }
}
